-
Notifications
You must be signed in to change notification settings - Fork 0
Generate plugin spec #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@bentsherman Let's aim moving this to "Ready" |
|
I am testing the entire flow with the registry locally. Before we merge this PR, we need to:
|
|
You should be able to test everything in the local dev. Check this for using unreleased plugin https://github.com/nextflow-io/nextflow/blob/a5c19b895a5d64ef4ae76907b5f38dc7074df22e/settings.gradle#L17-L19 |
ff9f074 to
7b62479
Compare
7b62479 to
2bfc7dc
Compare
b5bb1f9 to
716dc2d
Compare
716dc2d to
8b413b3
Compare
|
@pditommaso this is ready to merge, tested with registry-dev and Nextflow 25.09.0-edge |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the abstract but now I've this problem
» ./gradlew releasePluginToRegistryIfNotExists
[Incubating] Problems report is available at: file:///Users/pditommaso/Projects/nextflow/build/reports/problems/problems-report.html
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/pditommaso/Projects/nextflow/plugins/nf-amazon/build.gradle' line: 17
* What went wrong:
An exception occurred applying plugin request [id: 'io.nextflow.nextflow-plugin', version: '1.0.0-beta.10']
> Failed to apply plugin 'io.nextflow.nextflow-plugin'.
> Cannot add a configuration with name 'specFileImplementation' as a configuration with that name already exists.
What's more concerning this PR introduces a circular dependencies with nextflow main runtime makes difficult to this plugin with nextflow itself, because when releasing a new nextflow version, the plugin will try to pull a nextflow dependency that does not yet exist.
I'm starting to think the spec should not be generated by this plugin, but instead it should be defined by each plugin itself. The build process should only invoked a well defined plugin interface
|
I'm confused. This project doesn't even use Gradle 9:
I think that's why I'm not getting a build error |
|
As far as I can tell there is no circular dependency:
In other words the plugin JAR is built before the spec file, and the same nextflow runtime specified by the plugin is used to build the spec. For this reason it only builds the spec if the nextflow version is >=25.09.0-edge |
|
The problem arise when using from nextflow build |
|
I see. Well, this is a good example where mavenLocal works better 😄 |
|
it remains a mess, for example when trying to make |
|
You mean for core plugins? The core plugins don't need to generate plugin specs, for that case we could just disable it |
|
@pditommaso I added a flag to not build the plugin spec, which should be used by the core plugins. I also fixed the issues with Gradle 9 with some help from Claude. Let me know if it works for you |
b7b8e92 to
5a03964
Compare
|
IMO it would be preferable a solution that works the same both for "internal" and external plugins. Exploring the annotation processor i've ended up with this solution. Have a look. |
|
It looks like your solution is more or less the same. You still use a class loader with the Nextflow runtime and the plugin JAR, only now you are loading all of the annotation classes by name instead of just the plugin spec entrypoint ( The problem here is that now the code for generating the JSON metadata is duplicated in Nextflow and the Gradle plugin. You still need this code in the Nextflow runtime to generate this metadata for the language server So if you want something that works for both core plugins and community plugins, the solution is what we merged in nextflow-io/nextflow#6361 in combination with this PR.
Let me know if you encounter any more issues using this PR |
|
Another option could be moving this project into the nextflow repo. That would allow the plugin to stay in sync core codebase. |
|
I'm not sure how that would work. The Gradle plugin is intended to be used with any version of Nextflow, but moving it into the Nextflow codebase would tie it to a specific Nextflow version |
|
In the codebase it uses the "inline" version. Other plugins the canonical distribution |
|
That's essentially what I have achieved in this PR -- the core plugins should just use |
|
For reference, the only alternative I ever came up with is the approach currently used by the language server: The language server defines the This approach is fine for the language server, but for third-party plugins it would break the "pure config" interface that we currently have with the Gradle plugin. Plugin devs would have to maintain a copy of |
|
Now I'm getting this If I add The first is the more problematic, I understand for nextflow plugins it should be used turned off, but the same problem can arise for third party plugins |
|
With this fix I am able to build Nextflow even without |
|
Have you tried it? I'm getting this error |
|
I thought I added a check for that, but guess i forgot. I will fix it |
|
Okay try again |
|
Ben, please try it otherwise this will never end |
|
Okay, I see how you're testing it now. Sorry for the back and forth. With this change I was able to run the release task for nf-azure |
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
|
It was still failing on my side 👉 fa585b9 🤷♂️ |
|
Refactored a bit and added more docs as reference |
This PR adds a
buildSpectask which generates a plugin spec using a custom entrypoint in the Nextflow runtimeIt is a Java task that loads the Nextflow runtime (requires 25.08.0-edge or later) and the plugin that was just built, so that it can load the plugin extension points and generate the index file using the
PluginSpecWriterclass in the Nextflow runtime.Depends on nextflow-io/nextflow#6361